package com.xinchen.quartz.core.test.QuartzManage;

import org.quartz.SchedulerException;

/**
 * Description:
 *
 * @author xinchen (xinchenmelody@gmail.com)
 * @date 2016/12/24 20:35.
 * @see 2016/12/24 20:35 Created
 ****************************************/

public class Main {
    public static String JOB_NAME = "动态任务调度";
    public static String TRIGGER_NAME = "动态任务触发器";
    public static String JOB_GROUP_NAME = "JOB_GROUP";
    public static String TRIGGER_GROUP_NAME = "JOB_GROUP";

    public static void main(String[] args) throws SchedulerException {
        try {
//            System.out.println("【系统启动】开始(每1秒输出一次)...");
//            QuartzManager.addJob(JOB_NAME, JOB_GROUP_NAME, TRIGGER_NAME, TRIGGER_GROUP_NAME, MyJob.class, "0/5 * * * * ?");

//            Thread.sleep(5000);
//            System.out.println("【修改时间】开始(每5秒输出一次)...");
//            QuartzManager.modifyJobTime(JOB_NAME, JOB_GROUP_NAME, TRIGGER_NAME, TRIGGER_GROUP_NAME, "0/5 * * * * ?");
//
//            Thread.sleep(10000);
            System.out.println("【移除定时】开始...");
            QuartzManager.removeJob(JOB_NAME, JOB_GROUP_NAME, TRIGGER_NAME, TRIGGER_GROUP_NAME);
            System.out.println("【移除定时】成功");
            QuartzManager.shutdownJobs();
        } catch (Exception e) {
            e.printStackTrace();
        }
//        QuartzManager.startJobs();
    }
}
